package threading;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: WHY
 * Date: 2022-09-17
 * Time: 17:33
 */
//有三个线程，分别只能打印A，B和C
//
//
//
//要求按顺序打印ABC，打印10次
//
//
//
//输出示例：
//
//ABC
//
//ABC
//
//ABC
//
//ABC
//
//ABC
//
//ABC
//
//ABC
//
//ABC
//
//ABC
//
//ABC
public class demo1 {
    public static void main(String[] args) {
        Thread t1=new Thread(()->{
                    for(int i=0;i<10;i++) {
                        System.out.println("A");

                    }
        },"这是俺的线程");

        Thread t2=new Thread(()->{
    for(int i=0;i<10;i++) {
        System.out.println("B");
    }
        },"这是俺的线程");
        Thread t3=new Thread(()->{
        for(int i=0;i<10;i++) {
            System.out.println("C");
        }

        },"这是俺的线程");
        t1.start();
        try {
            Thread.sleep(3000);
        } catch (InterruptedException e) {
            throw new RuntimeException(e);
        }
        t2.start();
        try {
            Thread.sleep(3000);
        } catch (InterruptedException e) {
            throw new RuntimeException(e);
        }
        t3.start();
    }
}
